package com.enjoyor.soa.traffic.server.tsms.dubbo.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import com.alibaba.dubbo.config.annotation.Service;
import com.enjoyor.soa.traffic.api.dto.tsms.PoliceCallNameDto;
import com.enjoyor.soa.traffic.api.service.dubbo.tsms.IDubboPoliceCallNameService;
import com.enjoyor.soa.traffic.core.tsms.domain.PoliceCallName;
import com.enjoyor.soa.traffic.core.tsms.service.IPoliceCallNameService;
import com.enjoyor.soa.traffic.util.helper.ReflectHelper;
import com.enjoyor.soa.traffic.util.pojo.Page;
import com.enjoyor.soa.traffic.util.pojo.ResultPojo;

@SuppressWarnings("rawtypes")
@Service(version = "1.0.0", timeout = 4000)
public class DubboPoliceCallNameService implements IDubboPoliceCallNameService{

	@Autowired
	private IPoliceCallNameService iPoliceCallNameService;
	@Override
	public ResultPojo getPoliceCallNamePage(Page page, String postId, String policeId, String callId,
			String executeTaskId) {
		// TODO Auto-generated method stub
		ResultPojo resultPojo = new ResultPojo(iPoliceCallNameService.getPoliceCallNamePage(page, postId, policeId, callId, executeTaskId));
		return resultPojo;
	}

	@Override
	public ResultPojo getPoliceCallNameList(String postId, String policeId, String callId, String executeTaskId) {
		// TODO Auto-generated method stub
		List<PoliceCallName> list = iPoliceCallNameService.getPoliceCallNameList(postId, policeId, callId, executeTaskId);
		ResultPojo resultPojo = new ResultPojo(ReflectHelper.listToList(list, PoliceCallNameDto.class));
		return resultPojo;
	}

	@Override
	public ResultPojo insertPoliceCallName(PoliceCallNameDto policeCallNameDto, String personName) {
		// TODO Auto-generated method stub
		iPoliceCallNameService.addPoliceCallName(ReflectHelper.beanToBean(policeCallNameDto, PoliceCallName.class),personName);
		return new ResultPojo();
	}

	@Override
	public ResultPojo updatePoliceCallName(PoliceCallNameDto policeCallNameDto, String personName) {
		// TODO Auto-generated method stub
		iPoliceCallNameService.editPoliceCallName(ReflectHelper.beanToBean(policeCallNameDto, PoliceCallName.class),personName);
		return new ResultPojo();
	}

	@Override
	public ResultPojo deletePoliceCallName(String callId, String personName) {
		// TODO Auto-generated method stub
		iPoliceCallNameService.deletePoliceCallName(callId, personName);
		return new ResultPojo();
	}

}
